Article 2: rendering content _ Section 2: WebControl rendering; Article 2: webcontrol1. Presentation process of WebControl
WebControl is derived from the Control class. Therefore, the rendering function of WebControl is based on the Control rendering logic, but it has a large extension.
First,
Asp.net|web compared to previous ASP versions, ASP. NET has been greatly improved. Among these improvements, the main point is the newly introduced server-side controls. Now we're going to work together on the HTMLControl and WebControl in asp.net, two types of server-side controls.
Recall: An example of not using a server-side control
To illustrate the benefits of the server-side controls, we now use the traditional ASP to make a page. The fu
7th back from webcontrol
Finally, I saw professional ASP. NET 2.0 Server Control and component development the third chapter of this book, the second chapter I did not talk about, is the user control (ascx control), has been omitted, now first focus on custom control. The third chapter of this book is about custom styles. It is very powerful to analyze some of the webcontrol source code! I am also very care
createdAppearance support. Suitable for visual control inheritance, such as: buttonCompositecontrol: Multiple controls are derived.Compound. It is suitable for developing standard controls in application Asp.net. Relationship: control is the base class of all controls of Asp.net,Webcontrol is inherited from control,Compositecontrol is inherited from webcontrol (a class added in ASP. net2.0 ).Although the
Control:
Render:WebControl inherited fromControl class, And overwritesRenderMethod. This method should be overwritten by subclass.
RenderChildren: child node used to present the control(UsuallyHTML)
RenderControl: Used to render controls(IsControlObject)
RenderChildren is the rendering control, whileCreateChildControls is mainly used to initialize the child control (note that it is not used to render the child control ).
WebControl:(InheritanceContro
We have discussed "inherit from compositecontrol to implement Toolbar Control". This article will inherit webcontrol to implement Toolbar Control with the same function and implement the same control in different ways, then compare the differences between the two.
Download program code: ASP. NET Server Control-day16.rar
1. Inheritance WebcontrolImplementation TbtoolbarWidget
Step1.New inheritance WebcontrolOf TbtoolbarWidget
Added the tbtoolbar con
System. Web. UI. webcontrols. webcontrol class
Main attributes:
Attribute
Type
Description
Controls
Controlscollection
Child widget
Controlstyle
Style
Style
Controlstylecreated
Bool
Returns a value indicating whether a style object is created for controlstyle.
Enabled
Bool
Tagkey
Htmltextwritertag
Obtain the system. Web. UI. htmlt
The web yesterday saw some of the posts of Bigeagle, feel a lot of benefit, but I do not agree, that is, Pagelet is a transitional program, in fact, in some simple control development, Pagelet is very convenient.
And Pagelet has a clear and intuitive character. Pagelet can support control drag and drop like WebForm. This greatly facilitates our programming. I personally think that the simple need to support the template of the empty pieces can be developed with Pagelet. It is the same as the
I wrote about usercontrol before http://www.cnblogs.com/coolkiss/archive/2010/09/07/1820467.html.
But the manager said that usercontrol is not reusable, so he switched to webcontrol and encountered some problems during the change process.
The main problem is that the control label contains sub-controls or Asp.net page variables.
The function I want to implement is to include sub-controls between controls.
At the same time
It can also be used
, the system automatically returns the server DatePicker. AutoPostBack = true;
In the Date input box, you can set whether to allow users to directly enter the date value DatePicker. InputDisable = false;
When the returned date value is different from the previous one, the DateChange event private void InitializeComponent () will be triggered (){This. DatePicker1.DateChanged + = new System. EventHandler (this. DatePicker1_DateChanged );This. Load + = new System. EventHandler (this. Page_Load );}#
Web Thank you, no in return, put something.
Just saw a lot of people below ask a DataTable or table to add a selection box, in fact, if you can do a webcontrol to achieve this function, the bottom is I do a webcontrol with a checkbox, because the annotation is more complete, So I'm not going to explain it.
Using System;
Using System.Collections;
Using System.Web.UI.WebControls;
Using System.Web.UI;
Nam
Recently, when performing form verification, the form contains three Textbox, one of which is a verification control that is not empty for verification in webcotrol, and the other two use JS verification, the last is a webcotrol button. We all know that it has an onclientclick event and an onclick event. Therefore, onclientclick verifies the server event executed by the client and the onclick event, but there is a problem, if both of them are usedCodeBut web
web| difference
Web controls and HTML controls are as good and versatile as they look.
But their internal implementation mechanism is completely different.
Web controls perform better than HTML controls
1. It is also quite handy to use, for example,
// Remove spaces at both ends of the string. The usage is string. Trim ()String. Prototype. Trim = function (){Return this. Replace (/(^/S *) | (/S * $)/g ,"");}
Function checkinput (){// Verification nameDocument. form1.addmessage1 _ messagetitle.
1We must set different template of the datalist object as diffirent appearance, such as itemplate, editplate, headertemplate, footertemplate. in edit template, update function shoshould have the update command name as 'update', and the same to
Http://www.dnzone.com/ShowDetail.asp? Newsid= 111
One of the new gifts from. net is Internet Explorer webcontrols version 1.0 of the ASP. net server controls. this is a suite of "rich" controls that lets you easy deal with structures like Treeview,
In Asp.net, when adding a client script (such as an onclick event) to a server-side control, a common method is to setAttributes. For example, Control. attributes ["onclick"] = "Return (window. Confirm ('....'));";. However, when using the above
I have been in the garden for a while, but I have been diving all the time. The atmosphere in the garden is very good. I like it very much.Today is the Dragon Boat Festival. It is also my first time to leave a message in the blog garden. I wish you
The vs2003 designer has an interesting feature: During winform design, the control has no tooltip. To add a toolbox, You need to drag a special tooptip control from the toolbox, at this time, a tooltip attribute will be added to all controls on the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.